#region License, Terms and Conditions
//
// Prawks - Copyright (c) 2007 Atif Aziz. All rights reserved.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 2.1 of the License, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
//
#endregion

namespace Prawks.DbMethods
{
    using System.Data;

    using IMethodImpl = CodeProvisioning.IMethodImpl;
    
    /// <summary>
    /// Allows a type to externally provide the implementation for an input (data access) method.
    /// </summary>
    
    public interface IDbMethod : IMethodImpl
    {
        /// <summary>
        /// Creates a new command object based on the signature of the bound method.
        /// </summary>
        /// <returns>
        /// Returns the new command object.
        /// </returns>
        /// <param name="connection">
        /// The connection the new command object is to be associated with.
        /// </param>
        /// <param name="values">
        /// Array of values to assign to the input parameters of the command.
        /// The order of the values must be the same as in the signature of the
        /// bound method.
        /// </param>

        IDbCommand CreateCommand(IDbConnection connection, object[] values);
    }

    /// <summary>
    /// Allows a type to externally provide the implementation for an ouput (data access) method.
    /// </summary>
    public interface IDbOutMethod : IMethodImpl 
    {
        /// <summary>
        /// Returns the output parameter values of a command object based on the
        /// signature of the bound method.
        /// </summary>
        /// <returns>
        /// Returns an array of output parameter values. The order of the value is
        /// dictated by the signature of the bound method.
        /// </returns>
        /// <param name="command">
        /// The command object whose output parameter values are to be returned.
        /// </param>

        object[] GetCommandOutputs(IDbCommand command);
    }
}
